#include"head.h"
#include<stdio.h>
#include<fcntl.h>
#include<string.h>
#include<unistd.h>

int main(int argc,char *argv[])
{
        int f1;
        int row_count=0;
        int size;
        char ch[4096];
        if((f1=open(argv[2],O_RDONLY))==-1)
        {
                printf("Failure to open file %s",argv[2]);
                exit(0);
        }
        size=read(f1,ch,4096);
	close(f1);
	if(strcmp(argv[1],"head")==0)
        head(ch,size);
	else if(strcmp(argv[1],"tail")==0)
	tail(ch,size);
return 0;	
}
                                                                                                                                                   
